# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test12
# Description:   迭代器
# Author:       ASUS
# Date:         2019/4/3
#-------------------------------------------------------------------------------


class RightTriangle:
    def __init__(self):
        self.n = 1

    def __next__(self):
        result = '*' * (2 * self.n -1)
        self.n += 1
        return result

    def __iter__(self):
        return self

rt = RightTriangle()
for e in rt:
    if len(e) > 20:
        break;
    print(e,)




